package com.nami.logic.service;

import com.nami.basic.enums.DownMsgErrorCode;
import com.nami.basic.packet.Packet;

/**
 * 描述：
 *
 * @Author: lbc
 * @Date: 2023-08-14 15:58
 * @email: 594599620@qq.com
 * @Description: keep coding
 */
public interface PacketFactory {

    /**
     * 组装packet
     *
     * @param cmd
     * @param body
     * @return
     */
    Packet newPacket(Integer cmd, Object body);

    /**
     * original packet
     *
     * @return
     */
    Packet newPacket();

    /**
     *
     * @param cmd
     * @param code
     * @param msg
     * @param body
     * @return
     */
    Packet newDownmsgRespPacket(Integer cmd, String code, String msg, Object body);

    /**
     * assembly
     *
     * @param cmd
     * @param errorCode
     * @param body
     * @return
     */
    Packet newDownmsgErrorRespPacket(Integer cmd, DownMsgErrorCode errorCode, Object body);

    /**
     * @param cmd
     * @param body
     * @return
     */
    Packet newDownmsgSuccPacket(Integer cmd, Object body);

}
